#ifndef MYGAMESCENE_H
#define MYGAMESCENE_H
#include <QGraphicsItem>
#include <QtGui>
#include "vague.h"
//#include "mymainwindow.h"
#include"QMouseEvent"

class Attaque;
class Ennemis;
class Defense;
class Projectile;


class MyMainWindow;

class MyGameScene : public QGraphicsScene
{

    static MyGameScene* instance;
    static int grille[16][16];
    QList <Vague> fileVague ;
    QList <Ennemis*> fileEnnemisJeu;
    QList <Defense*> fileDefenseJeu;
    QList <Projectile*> fileProjJeu;
    QString tour;
    float departx;
    float departy;
    int departRotation;



public:
    int NbVagueActivated;
    void mousePressEvent(QGraphicsSceneMouseEvent *event);
   // void mouseMoveEvent (QGraphicsSceneMouseEvent * mouseEvent );
    void initialiserJeu();
    void initialiserVague();
    void afficheimage(QString, int, int);
    void slotlancerVague(int i);
    Ennemis* cherchercollision(Attaque*);
    void ajoutEnnemis(Ennemis * e){
        fileEnnemisJeu.push_back(e);
    }

    static int getCase (int i, int j){ return grille[i][j]; }

    void monupdate();
    void setTour(QString e){
        tour=e;
    }
    static MyGameScene* getMyScene(){
        if(instance==0){
            instance = new MyGameScene();
        }
        return instance;
    }
    QString getTour(){
        return tour;
    }

    QList <Defense*> getFileDefenseJeu(){
        return fileDefenseJeu;
    }

   private :
    MyGameScene();

};

#endif // MYGAMESCENE_H
